import sys,threading,yaml,os,tkMessageBox,tkSimpleDialog
from Tkinter import (Button,Label,StringVar,Entry,Tk,Menu,OptionMenu)

class Calculator:
    
    def __init__ (self):
    
        self.effects = {
            "Burning":self.burning,
            "Bleeding":self.bleeding,
            "Poison":self.poison,
            "Confusion":self.confusion
            }
    
    def burning (self, level, condition_dmg):
        """ Returns burning damage/sec """
    
        return str(int(8 + (4 * level) + (0.25 + condition_dmg)))
    
    def bleeding (self, level, condition_dmg):
        """ Returns bleeding damage/sec """
    
        return str(int(0.5 * level + 0.05 * condition_dmg + 2.5))
    
    def poison (self, level, condition_dmg):
        """ Returns poison damage/sec """
    
        return str(int(4 + level + (0.1 * condition_dmg)))
    
    def confusion (self, level, condition_dmg):
        """ Returns confusion damage/skill use """
    
        return str(int(10 + (1.5 * level) + (0.15 * condition_dmg)))

    def attribute (self, level):
        """ Returns base attribute calculated from level """

        attr = 20
        for i in xrange(level):
            if i+1 < 10:
                x = 4
            elif i+1 in xrange(10,20):
                x = 6
            elif i+1 in xrange(20,30):
                x = 8
            elif i+1 in xrange(30,40):
                x = 10
            elif i+1 in xrange(40,50):
                x = 12
            elif i+1 in xrange(50,60):
                x = 14
            elif i+1 in xrange(60,70):
                x = 16
            elif i+1 in xrange(70,80):
                x = 18
            elif i+1 == 80:
                x = 20
            attr += x

        return attr
    
    calc = Calculator()
